import { reactive } from 'vue';
import { MeetingUser } from './index.d';
/**
 * 表单领用设备长度校验
 */
const userListLengthValidator = (list: MeetingUser[]) => list.length > 0;

const formRules = {
  startTime: [{ required: true, message: '请选择会议时间' }],
  content: [{ required: true, message: '请填写会议内容' }],
  userList: [
    {
      validator: userListLengthValidator,
      message: '请选择参会人员',
    },
  ],
};

const state = reactive<{
  appTimeRangePopupIsShow: boolean;
  meetingInfo: MeetingInfoApi.newDto;
  /**
   * 会议时间
   */
  meetingTime: string;
}>({
  appTimeRangePopupIsShow: false,
  meetingInfo: {},
  meetingTime: '',
});

export { formRules, state };
